package com.zdy.mapper;

import com.zdy.entity.User;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: deyou
 * @Date: 2021/4/14
 */
//代表持久层
@Repository
public interface UserMapper {

    //@Select("select * from tb_user")
    List<User> findAll() ;

    //@Select("select * from tb_user where user_Id = #{userId}")
    User findById(Integer userId);

  //  @Insert("insert into tb_user values(#{userId},#{userName},#{userAge})")
    Integer insert(User user);
    //@Update("update tb_user set user_Name=#{userName} where user_id =#{userId}")
    Integer update(Integer userId,String userName);

   // @Delete("delete  from tb_user where user_id = #{userId}")
    Integer delete(Integer userId);
}
